/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package javasetcollection;

import java.util.HashSet;
import java.util.Iterator;

/**
 *
 * @author human
 */
public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        HashSet<String> hs = new HashSet();
        hs.add("One");
        hs.add("Two");
        System.out.println(hs.add("Three"));
        System.out.println(hs.add("Three"));
        hs.add("Two");
        hs.add("one");
        
        System.out.println(" - - - - - - - - - - ");
        
        for (String str : hs) {
            System.out.println(str);
        }
        
        System.out.println(" - - - - - - - - - - ");
        
        Iterator<String> iterator = hs.iterator();
        
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
        }
    }
}
